package cn.qayy.po;

import java.util.Date;

import cn.qayy.dto.ClientDTO;
import cn.qayy.dto.MailListDTO;

/**
 * 
 * 
 * @author wangyu
 * 通讯录实体
 * @date 2018-09-05
 */
public class WxMailList {
    private Integer id;

    /**
     * 姓名
     */
    private String name;

    /**
     * 手机号
     */
    private String mobilePhone;

    /**
     * 职位
     */
    private String position;

    /**
     * 座机号码
     */
    private String machineNumber;

    /**
     * 传真号码
     */
    private String faxNumber;
    
    /**
     * 通讯地址
     */
    private String address;
    
    /**
     * 邮箱
     */
    private String email;

    /**
     * 地区
     */
    private String region;
    
    /**
     * 性别
     */
    private String sex;
    
    private Date mtime=new Date();//更新时间
    
    private Date ctime=new Date();//创建时间

    public Integer getId() {
        return id;
    }

    public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone == null ? null : mobilePhone.trim();
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position == null ? null : position.trim();
    }

    public String getMachineNumber() {
        return machineNumber;
    }

    public void setMachineNumber(String machineNumber) {
        this.machineNumber = machineNumber == null ? null : machineNumber.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region == null ? null : region.trim();
    }

	public String getFaxNumber() {
		return faxNumber;
	}

	public void setFaxNumber(String faxNumber) {
		this.faxNumber = faxNumber;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public WxMailList(Integer id, String name, String mobilePhone, String position, String machineNumber,
			String faxNumber, String address, String email, String region, String sex, Date mtime, Date ctime) {
		super();
		this.id = id;
		this.name = name;
		this.mobilePhone = mobilePhone;
		this.position = position;
		this.machineNumber = machineNumber;
		this.faxNumber = faxNumber;
		this.address = address;
		this.email = email;
		this.region = region;
		this.sex = sex;
		this.mtime = mtime;
		this.ctime = ctime;
	}

	public Date getMtime() {
		return mtime;
	}

	public void setMtime(Date mtime) {
		this.mtime = mtime;
	}

	public Date getCtime() {
		return ctime;
	}

	public void setCtime(Date ctime) {
		this.ctime = ctime;
	}

	public WxMailList() {
		super();
	}

	@Override
	public String toString() {
		return "WxMailList [id=" + id + ", name=" + name + ", mobilePhone=" + mobilePhone + ", position=" + position
				+ ", machineNumber=" + machineNumber + ", faxNumber=" + faxNumber + ", address=" + address + ", email="
				+ email + ", region=" + region + ", sex=" + sex + ", mtime=" + mtime + ", ctime=" + ctime + "]";
	}

	/**
	 * 通过DTO初始化
	 * @param dto
	 * @return
	 */
	public WxMailList setByDTO(MailListDTO dto) {
		this.setMobilePhone(dto.getMobilePhone());
		this.setPosition(dto.getPosition());
		this.setMachineNumber(dto.getMachineNumber());
		this.setEmail(dto.getEmail());
		this.setRegion(dto.getRegion());
		this.setName(dto.getName());
		this.setAddress(dto.getAddress());
		this.setFaxNumber(dto.getFaxNumber());
		this.setSex(dto.getSex());
		return this;
	}
    
    
}